package java101;

import javax.swing.JOptionPane;

public class ChangeForADollar {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		
		String input = JOptionPane.showInputDialog
		("How many cents do you have?");
		int total = Integer.parseInt(input); //Total money amount
		int c = 0; //Number of combinations
		int p = 0; //Penny count
		int n = 0; //Nickel count
		int d = 0; //Dime count
		int q = 0; //Quarter Count
		
		
		//System.out.format("%3d:%3d:%3d:%3d:%3d\n", c,q,d,n,p);
		
		for (q = 0; q <= total / 25; q++) {
			
			for (d = 0; d <= total / 10; d++) {
				
				for (n = 0; n <= total / 5; n++) {
					
					for (p = 0; p <= total; p++) {
						
						if ((q * 25) + (d * 10) + (n * 5) + (p) == total) {
							c++;
							System.out.format("%3d:%3d:%3d:%3d:%3d\n", c,q,d,n,p);
						}
						
					}
				}
			}
		}

		System.out.println("You can make " + c + " combinations with " + total + " cents.");
	}



}
